﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace yule.Util
{

    /// <summary>
    /// 验证
    /// </summary>
    public static class Verificate
    {

        /// <summary>
        /// 判断int类型是否为空
        /// 判断是否为(int.MinValue)或者(int.MaxValue)
        /// </summary>
        /// <param name="val"></param>
        /// <returns></returns>
        public static bool IsNull(int val)
        {
            return val == int.MinValue || val == int.MaxValue;
        }

        /// <summary>
        /// 判断string类型是否为空
        /// 采用string.IsNullOrWhiteSpace方法
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool IsNull(string str)
        {
            return string.IsNullOrWhiteSpace(str);
        }

        /// <summary>
        /// 判断对象是否为空
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static bool IsNull(object obj)
        {
            return obj == null;
        }
    }

}
